#ifndef HTTP_UTILS_H
#define HTTP_UTILS_H

#include <stdbool.h>
#include "curl/curl.h"

# ifdef __cplusplus
extern "C" {
# endif

// HTTP Code
#define HTTP_CODE_BAD_REQUEST 400
#define HTTP_CODE_UNAUTHORIZED 401
#define HTTP_CODE_FORBIDDEN 403
#define HTTP_CODE_404 404
#define HTTP_CODE_OK 200

int Http_sendGetRequest(CURL* curl, const char* url, void* response);
int Http_sendPostRequest(CURL* curl, const char* url, const char* body, void* response, void* responseData, long* httpCode);

void Http_changeHttpAuthPassword(char* username, char* password);
void Http_disableHttpAuth();

void Http_enableSSL(bool enable);
void Http_disableSSL();

CURL* Http_initSession();
void Http_cleanupSession();
void Http_clearupSession();
CURL* Http_getCurrentSession();
bool Http_isSessionExist();
void Http_closeSession();

void Http_translateHttpCode(int httpCode, char* result);

# ifdef __cplusplus
}
# endif

#endif // HTTP_UTILS_H
